$(function(){
	
	/**
	 * setcookie和getcookie
	 */
	$("#regedit").click(function(){
		setCookies("user",$(".user").attr("value"));
		setCookies("password",$(".password").attr("value"));
		
		var user = getCookie("user");
		var password = getCookie("password");
		alert("user:"+user+","+"password:"+password);
	});
	
	$("#getAllCookie").click(function(){
			alert(document.cookie);
	});
	
	/**
	 * 在本机上从cookie获得用户和用户密码，没加密
	 */
	$("#rememberPassword").click(function(){
		var user = getCookie("user");
		var password = getCookie("password");
		
		$(".user").attr("value",user);
		$(".password").attr("value",password);
	});
	
	/**
	 * 删除指定cookie
	 */
	$("#deleteCookie").click(function(){
		var deleteCookieKey = $("#deleteCookieKey").attr("value");
		delCookies(deleteCookieKey);
	});
});